Skip to content

Strip credentials on cross-origin redirects#589

Merged
ryanfowler merged 1 commit into
mainfrom
fix-redirect-credential-leak
May 26, 2026
Merged

Strip credentials on cross-origin redirects#589
ryanfowler merged 1 commit into
mainfrom
fix-redirect-credential-leak

Conversation

@ryanfowler
Copy link
Copy Markdown
Owner

Summary

  • Track the original request origin and treat scheme/host/effective-port changes as cross-origin redirects.
  • Strip Authorization, Cookie, and Proxy-Authorization before sending redirected requests to a different origin.
  • Skip reapplying CLI Basic/Bearer auth, AWS SigV4 signing, and digest replay on cross-origin redirects.
  • Add integration coverage with two local servers for explicit sensitive headers, CLI auth, AWS auth, and digest auth.

Testing

  • cargo fmt
  • cargo clippy --locked --all-targets --all-features -- -D warnings
  • cargo test --all-features
  • cargo test --all-features --test integration -- --test-threads=1

@ryanfowler ryanfowler merged commit 1ad22c0 into main May 26, 2026
4 checks passed
@ryanfowler ryanfowler deleted the fix-redirect-credential-leak branch May 26, 2026 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant